// 00
import axiosReq from '@/utils/axios-req'

export const getMenuTreeReq = () => {
    return axiosReq({
        url: 'admin/setting/menu/tree',
        method: 'get',
    })
}

export const addMenuReq = (data) => {
    return axiosReq({
        url: 'admin/setting/menu',
        method: 'post',
        data
    })
}
export const editMenuReq = (id, data) => {
    return axiosReq({
        url: `admin/setting/menu/${id}`,
        method: 'put',
        data
    })
}

export const delMenuReq = (id) => {
    return axiosReq({
        url: `admin/setting/menu/${id}`,
        method: 'delete'
    })
}

export const getRoleReq = (data) => {
    return axiosReq({
        url: 'admin/setting/role',
        method: 'get',
        data,
        isParams: true
    })
}

export const addRoleReq = (data) => {
    return axiosReq({
        url: 'admin/setting/role',
        method: 'post',
        data
    })
}
export const editRoleReq = (id, data) => {
    return axiosReq({
        url: `admin/setting/role/${id}`,
        method: 'put',
        data
    })
}

export const delRoleReq = (ids) => {
    return axiosReq({
        url: `admin/setting/role`,
        method: 'delete',
        data: {ids}
    })
}

export const getUserReq = (data) => {
    return axiosReq({
        url: 'admin/setting/user',
        method: 'get',
        data,
    })
}

export const addUserReq = (data) => {
    return axiosReq({
        url: 'admin/setting/user',
        method: 'post',
        data
    })
}

export const editUserReq = (id, data) => {
    return axiosReq({
        url: `admin/setting/user/${id}`,
        method: 'put',
        data
    })
}

export const delUserReq = (ids) => {
    return axiosReq({
        url: `admin/setting/user`,
        method: 'delete',
        data: {ids}
    })
}

export const resetPasswordReq = (id) => {
    return axiosReq({
        url: `admin/setting/user/${id}/resetpassword`,
        method: 'put',
    })
}
